﻿@{
    Layout = null;
}
@using MvcMall.AdminPortal.Controllers.Article.ViewModels;
@model ArticleModel
<!DOCTYPE html>
<html>
<head>
    <title>
        @if (Model != null)
        {
            @:修改文章
        }
        else
        { @:新增文章
                                                }</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#tabs").tabs({
                ajaxOptions: {
                    error: function (xhr, status, index, anchor) {
                        $(anchor.hash).html("系统繁忙,请稍候再试");
                    }
                }
            });
        });  
    </script>
</head>
<body>
    <div id="tabs">
        <ul>
            <li><a href="#saveMenu">
                @if (Model != null)
                {
                    @:修改文章
            }
                else
                { @:新增文章
                                                                                                                                                                                                                                                               
                }
            </a></li>
        </ul>
        <div id="saveMenu">
            @using (Html.BeginForm("Save", "Article", FormMethod.Post, new { Id = "articleForm" }))
            {
                
                <div class="editor-label">
                    @Html.HiddenFor(m => m.ArticleId)
                    @Html.LabelFor(m => m.Title)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(x => x.Title, new { @maxlength = "128", @style = "width:750px;" })
                    @Html.ValidationMessageFor(x => x.Title)
                </div>
              
                <div class="editor-label">
                    @Html.LabelFor(m => m.ArticleCategoryId)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(m => m.ArticleCategoryId, ViewData["ArticleCategoryList"] as IEnumerable<SelectListItem>)
                    @Html.ValidationMessageFor(x => x.ArticleCategoryId)
                </div>
                 
                <div class="editor-label">
                    @Html.LabelFor(m => m.Content)
                </div>
                <div class="editor-field">
                    @Html.TextAreaFor(m => m.Content)
                    @Html.ValidationMessageFor(x => x.Content)
                </div>
                    
                <div class="editor-label">
                    @Html.LabelFor(m => m.SortOrder)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.SortOrder)
                    @Html.ValidationMessageFor(x => x.SortOrder)
                </div>
                <div class="editor-label">
                    @Html.LabelFor(m => m.IsShow)
                </div>
                <div class="editor-field">
                    @Html.CheckBoxFor(m => m.IsShow)
                </div>
                <p>
                    <input type="submit" value="保存" /></p> 
            }
        </div>
    </div>
    <script src="@Url.Content("~/WebEdit/ckeditor/ckeditor.js")" type="text/javascript"></script>
    <script type="text/javascript"> 
    //<![CDATA[
        CKEDITOR.replace('Content',
						{
						    skin: 'kama',
						    enterMode: Number(2),
						    shiftEnterMode: Number(1),
						    uiColor: '#7CBDDC',
						    filebrowserBrowseUrl: '@Url.Content("~/WebEdit/ckfinder/ckfinder.html")',
						    filebrowserImageBrowseUrl: '@Url.Content("~/WebEdit/ckfinder/ckfinder.html?Type=Images")',
						    filebrowserFlashBrowseUrl: '@Url.Content("~/WebEdit/ckfinder/ckfinder.html?Type=Flash")',
						    filebrowserUploadUrl: '@Url.Content("~/WebEdit/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files")',
						    filebrowserImageUploadUrl: '@Url.Content("~/WebEdit/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images")',
						    filebrowserFlashUploadUrl: '@Url.Content("~/WebEdit/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash")'
						});
 
    //]]> 		 
    </script>
</body>
</html>
